80s toys - Atari. I still have
Mobile Entertainment

JAVASCRIPTS
Browser Detector

Example :

Code : <script type="text/javascript"> document.write("Browser CodeName: " + navigator.appCodeName); document.write("<br /><br />"); document.write("Browser Name: " + navigator.appName); document.write("<br /><br />"); document.write("Browser Version: " + navigator.appVersion); document.write("<br /><br />"); document.write("Cookies Enabled: " + navigator.cookieEnabled); document.write("<br /><br />"); document.write("Platform: " + navigator.platform); document.write("<br /><br />"); document.write("User-agent header: " + navigator.userAgent); </script>

Function IF

Example (if the visitor use Opera Mini, he/she will see the warning, other doesn't.):

Code : <script type="text/javascript"> x=(navigator.appName); if (x=="Opera") { document.write("we detect that you are using <b>Opera Mini</b>, you need to press Menu » Tools » Setting » uncheck \"Mobile View\" » OK (then reload/refresh) in order to view the optimized design for your browser."); } else { document.write("Your browser is not Opera Mini"); } </script>

Say Greeting

Example (Write a "Good morning" greeting if the time is less than 10) :

Code : <script type="text/javascript"> var d=new Date(); var time=d.getHours(); if (time<10)   {   document.write("<b>Good morning</b>");   } </script>

Say Greeting 2

Example (If the time is less than 10, you will get a "Good morning" greeting. Otherwise you will get a "Good day" greeting.) :

Code : <script type="text/javascript"> var d = new Date(); var time = d.getHours(); if (time < 10)   {   document.write("Good morning!");   } else   {   document.write("Good day!");   } </script>

Say Greeting 3

Example :

Code : <script type="text/javascript"> var d = new Date() var time = d.getHours() if (time<10)   {   document.write("<b>Good morning</b>");   } else if (time>10 && time<16)   {   document.write("<b>Good day</b>");   } else   {   document.write("<b>Hello World!</b>");   } </script>
Next Page>>

Airtel Free Internet Software


Users Online: 1
Total Visitors: 296
Boost your Site Traffic
Copyright©2013-2015
BongoPilot
Statistics